//
//  OMOrder.h
//  OMENGO
//
//  Created by 梁尚嘉 on 2016/12/27.
//  Copyright © 2016年 Kamfat. All rights reserved.
//

#import "BaseModel.h"
#import "OMProduct.h"
#import "OMRefund.h"

@class OMOrderItem;

/**
 * 状态
 */
typedef enum {
    /** 等待付款 */
    pendingPayment,

    /** 等待审核 */
    pendingReview,

    /** 等待发货 */
    pendingShipment,

    /** 已发货 */
    shipped,

    /** 已收货 */
    received,

    /** 已完成 */
    completed,

    /** 已失败 */
    failed,

    /** 已取消 */
    canceled,

    /** 已拒绝 */
    denied,

    /** 未完成 */
    unfinished,

    /** 退款中 */
    refunding,

    /** 退款完成 */
    refunded,

    /** 所有已取消 */
    allCanceled,

    /** 已评价 */
    reviewed
    
}OrderStatus;


@interface OMOrder : BaseModel
@property (nonatomic, copy) NSString *amount;
@property (nonatomic, copy) NSString *sn;
@property (nonatomic, copy) NSString *id;

@property (nonatomic, copy) NSString *createDate;
@property (nonatomic, copy) NSString *modifyDate;

@property (nonatomic, copy) NSString *freight;
@property (nonatomic, copy) NSString *address;
@property (nonatomic, copy) NSString *areaName;
@property (nonatomic, copy) NSString *consignee;
@property (nonatomic, assign) float couponDiscount;
@property (nonatomic, assign) float exchangePoint;
@property (nonatomic, assign) float fee;
@property (nonatomic, assign) BOOL isAlloctedStock;
@property (nonatomic, assign) BOOL isExchangePoint;
@property (nonatomic, assign) BOOL isUseCouponCode;
@property (nonatomic, copy) NSString *memo;
@property (nonatomic, copy) NSString *paymentMethodId;
@property (nonatomic, assign) NSUInteger paymentMethodType;
@property (nonatomic, copy) NSString *phone;
@property (nonatomic, copy) NSString *price;
@property (nonatomic, assign) float promotionDiscount;
@property (nonatomic, copy) NSString *promotionNames;
@property (nonatomic, assign) NSUInteger quantity;
@property (nonatomic, assign)NSUInteger refundAmount;
@property (nonatomic, assign) float rewardPoint;
@property (nonatomic, assign) NSUInteger shippedQuantity;
@property (nonatomic, assign) float tax;
@property (nonatomic, assign) NSUInteger type;
@property (nonatomic, copy) NSString *weight;
@property (nonatomic, copy) NSString *shippingMethodName;
@property (nonatomic, copy) NSString *paymentMethodName;
@property (nonatomic, assign) OrderStatus status;
@property (nonatomic, copy) NSString *statusName;

@property (nonatomic, strong) NSArray <OMOrderItem*>*orderItems;
@property (nonatomic, copy) NSString *refundsId;
@property (nonatomic, strong) NSArray <OMRefund*>*refunds;


@property (nonatomic, copy) NSString *desc;

@end



@interface OMOrderItem : BaseModel <OMProductProtocol>
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *price;
@property (nonatomic, copy) NSString *sn;
@property (nonatomic, copy) NSString *image;
@property (nonatomic, copy) NSString *id;
@property (nonatomic, assign) NSUInteger type;
@property (nonatomic, copy) NSString *specifications;
@property (nonatomic, assign) BOOL isDelivery;
@property (nonatomic, assign) NSUInteger quantity;
@property (nonatomic, copy) NSString *weight;
@property (nonatomic, copy) NSString *unit;
@property (nonatomic, copy) NSString *brand;
@end
